#ifndef UDPCOMM_H
#define UDPCOMM_H

#include <QMainWindow>
#include <QUdpSocket>
#include <QHostAddress>
#include <QHostInfo>
#include <QPlainTextEdit>
#include <QPushButton>
#include <QSpinBox>
#include <QComboBox>
#include <QLineEdit>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QWidget>

class udpComm : public QMainWindow
{
Q_OBJECT

public:
    udpComm(QWidget *parent = nullptr);
    ~udpComm();

private slots:
    void on_pushButton_start_clicked();
    void on_pushButton_stop_clicked();
    void on_pushButton_sendmsg_clicked();
    void on_pushButton_broadcastmsg_clicked();
    void SocketReadyReadData();

private:
    QString GetLocalIpAddress();

    QUdpSocket *udpsocket;

    QSpinBox *spinBoxbindport;
    QSpinBox *spinBoxtargetport;
    QComboBox *comboBoxtargetip;
    QLineEdit *lineEditmsg;
    QPushButton *pushButton_start;
    QPushButton *pushButton_stop;
    QPushButton *pushButton_sendmsg;
    QPushButton *pushButton_broadcastmsg;
    QPlainTextEdit *plainTextEditdispmsg;
};

#endif // UDPCOMM_H
